<template>
	<view class="my-search-container" @click="searchBoxHandler">
		<view class="my-search-box">
			<uni-icons type="search" size="17"></uni-icons>
			<text class="placeholder">搜索</text>
		</view>
	</view>
</template>

<script setup>
	import {
		defineEmits
	}
	from 'vue'
	// 自定义事件
	const emit = defineEmits(['search'])
	// 点击事件
	const searchBoxHandler = () => {
		emit('search')
	}
</script>

<style lang="less">
	.my-search-container {
		height: 50px;
		display: flex;
		align-items: center;
		padding: 0 10px;
		background-color: #7bbfea;

		.my-search-box {
			height: 36px;
			background-color: #f3f3f3;
			display: flex;
			justify-content: center;
			width: 100%;
			align-items: center;
			border-radius: 18px;

			.placeholder {
				font-size: 15px;
				margin-left: 5px;
			}
		}
	}
</style>